<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>html2canvas example</title>
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="js/html2canvas.js"></script>
	</head>
	<script type="text/javascript">
		function takeScreenshot() {debugger;
			console.log('test');
			html2canvas(document.getElementById('view'), {
				onrendered: function(canvas) {
					document.body.appendChild(canvas);
				},
				// width: 300,
				// height: 300
			});
		}
	</script>
	<body>
		<div id="view" style="background:url(test.jpg) 50%; width: 700px; height: 500px;">
			<input type="button" value="截图" onclick="takeScreenshot()">
		</div>
	</body>

</html>
